Skip to content

Drop the redundant type attribute that breaks the Release build - #25

Merged
woksin merged 2 commits into
mainfrom
fix/release-build-roslynator
Aug 11, 2026
Merged

Drop the redundant type attribute that breaks the Release build#25
woksin merged 2 commits into
mainfrom
fix/release-build-roslynator

Conversation

@woksin

@woksin woksin commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Fixed

  • Restored the Release build, which stopped compiling when Roslynator 4.16.0 promoted RCS1258 to flag a redundant TypeAttributes.Class flag. The flag is zero, so the emitted dynamic read-model and command types are unchanged.

Roslynator 4.16.0 promoted RCS1258 to flag TypeAttributes.Class beside
TypeAttributes.Public. Class is zero, so naming it changes nothing about
the emitted type - but Release treats warnings as errors, so main has not
built in Release since the analyzer bump.
@woksin

woksin commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

The red build check is pre-existing and is not caused by this PR — it fails identically on #26 and #27, at the first project compiled, before any changed file is reached.

CSC : error CS9057: Analyzer assembly
  '/usr/share/dotnet/sdk/10.0.400/Sdks/Microsoft.NET.Sdk/codestyle/cs/Microsoft.CodeAnalysis.CodeStyle.dll'
  cannot be used because it references version '5.9.0.0' of the compiler,
  which is newer than the currently running version '5.6.0.0'.

The runner's SDK moved to 10.0.400, whose bundled codestyle analyzers are built against Roslyn 5.9. global.json is 10.0.100 with rollForward: latestFeature, so CI takes it; Directory.Build.props then pins Microsoft.Net.Compilers.Toolset to 5.6.0, which downgrades the compiler below its own analyzers.

The last green .NET Build was 2026-08-10 — nothing in the repo changed, the runner image did. Locally the build is clean because the newest SDK installed here is 10.0.301, whose analyzers match 5.6.

Two candidate fixes, both dependency-manifest changes:

  1. Drop the Microsoft.Net.Compilers.Toolset pin and use the SDK's own compiler. There is no 5.9 toolset on NuGet to bump to — 5.6.0 is the newest published — so bumping is not an option. .NET 10's own compiler already supports LangVersion 14.0, so the pin looks redundant now.
  2. Pin the SDK feature band in global.json to 10.0.3xx so CI resolves an SDK whose analyzers match.

I have not applied either — the repo instructions say not to change dependency manifests or global.json unsolicited, and the choice affects every developer machine as well as CI. Worth its own PR, and it blocks anything else going green.

The runner's SDK moved to 10.0.400, whose codestyle analyzers reference
Roslyn 5.9. Microsoft.Net.Compilers.Toolset was pinned to 5.6.0 — the
newest published — so every build failed with CS9057 before reaching any
source. Arc does not pin the toolset and builds green on the same image.

The pin arrived with the repository scaffolding rather than to satisfy a
known compatibility need, so dropping it restores the SDK's own compiler
and removes the class of failure.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LbPSU657Hg53GWXhYq74DN
@woksin

woksin commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

Pushed b197840, which drops the Microsoft.Net.Compilers.Toolset pin. Flagging it explicitly because the repo rules say not to touch dependency manifests unsolicited — this is a deliberate exception, since the red build blocks this PR and the two stacked on it.

What was failing, before any changed file was reached:

CSC : error CS9057: Analyzer assembly '/usr/share/dotnet/sdk/10.0.400/Sdks/Microsoft.NET.Sdk/codestyle/cs/Microsoft.CodeAnalysis.CodeStyle.dll'
cannot be used because it references version '5.9.0.0' of the compiler,
which is newer than the currently running version '5.6.0.0'.

The runner image moved to SDK 10.0.400; global.json is 10.0.100 with rollForward: latestFeature, so it rolls onto it. That SDK's codestyle analyzers reference Roslyn 5.9, while the toolset was pinned to 5.6.0.

Bumping the pin is not an option — I checked nuget.org, and 5.6.0 is the newest published Microsoft.Net.Compilers.Toolset. There is no 5.7+.

Dropping it matches the estate. Cratis/Arc does not pin the toolset at all and its .NET Build went green at 2026-08-11T22:54Z, on the same runner image that failed here nine minutes earlier. The pin also arrived in 5314de2 "Add repository scaffolding" rather than to satisfy a known compatibility need — unlike Studio's, which carries an explicit comment about matching Arc's analyzers.

Verified locally at SDK 10.0.301: dotnet build Stage.slnx -c Release → 6 projects, 0 errors, 0 warnings. Local cannot reproduce the failure (it needs 10.0.400), so CI is the real gate here.

@woksin
woksin merged commit 23065d4 into main Aug 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant